+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
+Wed Nov 15 16:02:20 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtktextview.c (changed_handler): Call scroll_calc_now()
+ unconditionally, since we may need to update the horizontal
+ scrollbars even if the height didn't change.
+
+ * gtk/gtktextlayout.c (add_preedit_attrs): Always get
+ the extra attrs, since some of them affect size.
+
+ * gtk/gtktextdisplay.c (gtk_text_layout_draw): Factor in
+ x_offset correctly.
+
2000-11-15 Havoc Pennington <hp@redhat.com>
* gtk/gtktextlayout.c (set_para_values): If indent is negative,
gtk_text_layout_draw (GtkTextLayout *layout,
GtkWidget *widget,
GdkDrawable *drawable,
- /* Location of the layout
- in buffer coordinates */
+ /* Location of the drawable
+ in layout coordinates */
gint x_offset,
gint y_offset,
/* Region of the layout to
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
gdk_draw_line (drawable, gc,
- line_display->x_offset + cursor->x,
+ line_display->x_offset + cursor->x - x_offset,
current_y + line_display->top_margin + cursor->y,
- line_display->x_offset + cursor->x,
+ line_display->x_offset + cursor->x - x_offset,
current_y + line_display->top_margin + cursor->y + cursor->height - 1);
cursor_list = cursor_list->next;
gint *width,
gint *height)
{
- gint w, h;
-
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
- gtk_text_btree_get_view_size (_gtk_text_buffer_get_btree (layout->buffer),
- layout,
- &w, &h);
-
- layout->width = w;
- layout->height = h;
-
if (width)
*width = layout->width;
layout);
}
+static void
+update_layout_size (GtkTextLayout *layout)
+{
+ gtk_text_btree_get_view_size (_gtk_text_buffer_get_btree (layout->buffer),
+ layout,
+ &layout->width, &layout->height);
+}
+
/**
* gtk_text_layout_validate_yrange:
* @layout: a #GtkTextLayout
line = gtk_text_line_next (line);
}
- /* If we found and validated any invalid lines, emit the changed singal
+ /* If we found and validated any invalid lines, update size and
+ * emit the changed signal
*/
if (first_line)
{
- gint line_top =
- gtk_text_btree_find_line_top (_gtk_text_buffer_get_btree (layout->buffer),
- first_line, layout);
+ gint line_top;
+
+ update_layout_size (layout);
+
+ line_top = gtk_text_btree_find_line_top (_gtk_text_buffer_get_btree (layout->buffer),
+ first_line, layout);
gtk_text_layout_changed (layout,
line_top,
&y, &old_height, &new_height))
{
max_pixels -= new_height;
+
+ update_layout_size (layout);
gtk_text_layout_changed (layout, y, old_height, new_height);
}
}
end = layout->preedit_len;
pango_attr_iterator_get_font (iter, &style->font,
- &font_desc, size_only ? NULL : &extra_attrs);
+ &font_desc, &extra_attrs);
tmp_list = extra_attrs;
while (tmp_list)
yoffset_changed = TRUE;
}
- gtk_text_view_scroll_calc_now (text_view);
-
if (yoffset_changed)
gtk_adjustment_value_changed (get_vadjustment (text_view));
}
+
+ gtk_text_view_scroll_calc_now (text_view);
}
static void
gtk_text_layout_get_size (text_view->layout, &width, &height);
-#if 0
- /* If the width is less than the screen width (likely
- if we have wrapping turned on for the whole widget),
- then we want to set the scroll region to the screen
- width. If the width is greater (wrapping off) then we
- probably want to set the scroll region to the width
- of the layout. I guess.
- */
-
- width = MAX (text_view->layout->screen_width, width);
- height = height;
-#endif
-
if (text_view->width != width || text_view->height != height)
{
-#if 0
- printf ("layout size set, widget width is %d\n",
- GTK_WIDGET (text_view)->allocation.width);
-#endif
text_view->width = width;
text_view->height = height;